<?php
  //echo $this->Html->css('calendar/fullcalendar');
$pageOption = $this->Paginator->params();
?>

<div id="content-outer">
  <div id="content">
	<!--  start page-heading -->
	<div id="page-heading">
		<h1><?php echo __('Events');?></h1>
    <?php //echo $this->Html->link("Ticket", array('action' => 'add')); ?>&nbsp;&nbsp;
	</div>
	<!-- end page-heading -->
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
  	<tr>
  		<th rowspan="3" class="sized">
          <?php //echo $this->Html->image('/images/shared/side_shadowleft.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
      </th>
  		<th class="topleft"></th>
  		<td id="tbl-border-top">&nbsp;</td>
  		<th class="topright"></th>
  		<th rowspan="3" class="sized">
          <?php //echo $this->Html->image('/images/shared/side_shadowright.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
      </th>
  	</tr>
  	<tr>
  		<td id="tbl-border-left"></td>
  		<td>
  		<!--  start content-table-inner ...................................................................... START -->
    		<div id="content-table-inner">
      			<!--  start table-content  -->
                <div class="events index">
                   <div id="table-content">
            				<table border="0" cellpadding="0" cellspacing="0" id="product-table">
              				<tr>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo $this->Paginator->sort('event_type_id'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo $this->Paginator->sort('title'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo $this->Paginator->sort('status'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo $this->Paginator->sort('start'); ?>
                        </th>
              					<th class="table-header-repeat line-left minwidth-1">
                             <?php echo $this->Paginator->sort('end'); ?>
                        </th>
              					<th class="table-header-repeat line-left">
                             Action
                        </th>          
              				</tr>

                    	<?php
                    	$i = 0;
                    	foreach ($events as $event):
                    		$class = null;
                    		if ($i++ % 2 == 0) {
                    			$class = ' class="altrow"';
                    		}
                    	?>
                    	<tr<?php echo $class;?>>
                    		<td>
                    			<?php echo $event['EventType']['name']; ?>
                    		</td>
                    		<td><?php echo $event['Event']['title']; ?></td>
                    		<td><?php echo $event['Event']['status']; ?></td>
                    		<td><?php echo $event['Event']['start']; ?></td>
                            <?php if($event['Event']['all_day'] == 0) { ?>
                       		<td><?php echo $event['Event']['end']; ?></td>
                            <?php } else { ?>
                    		<td>N/A</td>
                            <?php } ?>
                    		<td class="actions">
                    			<?php echo $this->Html->link(__('View', true), array('action' => 'view', $event['Event']['id'], 'admin' => false)); ?>
                    		</td>
                    	</tr>
                    <?php endforeach; ?>
                </table>
              	<div class="paging">
                  		<!--  start paging..................................................... -->
                    <? if($pageOption['pageCount'] > 1): ?>	
                      <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
                          <?php echo $this->element('pagination');?>       
                  		</table> 
                  		<!--  end paging................ -->
                    <? endif; ?>	
              	</div>
              </div>
            </div>  
              <!--<div class="actions">
                  <h2>Upcoming Birthday</h2>
                  <ul>
              	    <?php foreach($birthdays as $birthday): ?>
                      <li><?php echo $birthday['Customer']['f_name'].' '.$birthday['Customer']['f_name'].' '.$birthday['Customer']['birthday'] ?></li>
                    <?php endforeach; ?>
                	</ul>
              </div>-->
      <!--  end content-table  -->
    		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

  </div>
</div>